<?php
$params = Baogg_Controller::getUrlParams();
echo '<?xml version="1.0" encoding="utf-8" ?>'; 
?>  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php echo BAOGG_CHARSET; ?>" />
        <title>Add Tag</title>
        <style type="text/css">
            @import url("<?php echo BAOGG_CSS.$params['action']; ?>.css");
        </style>
        <script type="text/javascript" src="<?php echo BAOGG_AJAX?>jquery/jquery.js">
        </script>
    </head>
    <body>
        <?php
        echo $this->form;
        
        ?>
        <script type="text/javascript">
            function test(){
                $("form").submit(function(){
                    return false;
                });
                $("#submit").click(function(){
                    $.ajax({
                        url: $("#myform").attr("action") + "json/1/",
                        type: "GET",
                        error: function(flag){
                            console.info(flag);
                        },
                        success: function(flag){
                            var s = parseInt(flag);
                            if (!s) { //error 
                                console.info(flag);
                                alert("json failure");
                            }
                            else {
                                if (s == -1) { //update none,exist item
                                    alert("update none");
                                }
                                else { //update success
                                    alert("json suceful");
                                }
                                if (top && top.tb_remove) {
                                    top.location.href = top.location.href.replace("#", "");
                                    top.tb_remove();
                                }
                            }
                        }
                    });
                });
            };
        </script>
    </body>
</html>
